<template>
  <view class="blacklist">
    <view class="header">
      <tn-button 
        backgroundColor="transparent" 
        style="color: black; position: absolute; left: 5%; top: 10%; width: 35px; height: 35px; font-size: 25px;" 
        :border="false" 
        @click="handleReturn"
      >
        <text class="tn-icon-left"></text>
      </tn-button>
      <view class="title">黑名单</view>
    </view>

    <!-- 无黑名单成员时显示 -->
    <view v-if="blacklist.length === 0" class="empty-list">
      <image src="/static/fish_illustration.png" class="fish-image" />
      <text class="empty-text">看来您还没有遇到想要拉黑的人</text>
    </view>

    <!-- 有黑名单成员时显示 -->
    <view v-else class="blacklist-members">
      <view v-for="(member, index) in blacklist" :key="index" class="member-item">
        <image :src="member.avatar" class="member-avatar" />
        <text class="member-name">{{ member.name }}</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      // 模拟黑名单成员数据
      blacklist: [
        // 下面是测试数据
        { name: "张三", avatar: "/static/avatar1.png" },
        { name: "李四", avatar: "/static/avatar2.png" },
      ]
    };
  },
  methods: {
    // 返回按钮事件
    handleReturn() {
      uni.navigateBack({ delta: 1 });
    }
  }
};
</script>

<style scoped>
.blacklist {
  padding: 20px;
  background-color: #f8f8f8;
  height: 100%;
}

.header {
  position: relative;
  margin-top: 20px;
  text-align: center;
}

.title {
  font-size: 28px;
  font-weight: bold;
  color: #333;
  font-family: "宋体", SimSun, sans-serif; /* 修改字体为宋体 */
}

.empty-list {
  text-align: center;
  margin-top: 50px;
}

.fish-image {
  width: 150px;
  height: auto;
}

.empty-text {
  font-size: 18px;
  color: #555;
  margin-top: 15px;
  font-family: "宋体", SimSun, sans-serif; /* 修改字体为宋体 */
}

.blacklist-members {
  margin-top: 30px;
}

.member-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 15px;
}

.member-name {
  font-size: 16px;
  color: #333;
  font-family: "宋体", SimSun, sans-serif; /* 修改字体为宋体 */
}
</style>